<?php

use Phinx\Migration\AbstractMigration;

class CreateCountryTable extends AbstractMigration
{
    public function up()
    {
        $sql = <<<SSS
            CREATE TABLE `country` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `abbr2` char(2) NOT NULL COMMENT '国家简称，两位小写字母',
  `abbr3` char(3) NOT NULL DEFAULT '' COMMENT '国家简称，三位小写字母',
  `name` char(50) NOT NULL DEFAULT '' COMMENT '国家全称',
  `enabled` tinyint(4) NOT NULL DEFAULT '1' COMMENT 'Country Code 是否可用',
  PRIMARY KEY (`id`),
  UNIQUE KEY `abbr2` (`abbr2`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
SSS;
        $this->execute($sql);
    }
}
